package com.netease.homework.web.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.netease.homework.meta.Commodity;
import com.netease.homework.meta.User;
import com.netease.homework.service.ICommodityService;

/**
 * 
 * @author smart
 * @时间 2019年3月8日
 * @描述 视图相关Controller
 */
@Controller
public class ShowCtrl {

	@Autowired
	@Qualifier("CommodityService")
	private ICommodityService commodityService;
	
	/**
	 * 
	 * @描述 商品详情页
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/show", method = RequestMethod.GET)
	public String detail(HttpServletRequest request) {
		
		return "show";
	}
	
	/**
	 * 
	 * @描述 编辑商品页
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/edit", method = RequestMethod.GET)
	public String edit(HttpServletRequest request) {
		
		return "edit";
	}
	
	/**
	 * 
	 * @描述 商品编辑成功页
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/editSubmit", method = RequestMethod.GET)
	public String editSubmit(HttpServletRequest request) {
		
		return "editSubmit";
	}
	
	/**
	 * 
	 * @描述 商品发布成功页
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/publicSubmit", method = RequestMethod.GET)
	public String publicSubmit(HttpServletRequest request) {
		
		return "publicSubmit";
	}

	/**
	 * 
	 * @描述 展示所有商品页（首页） 
	 * @param request
	 * @return
	 */
	@RequestMapping(value="/")
	public String shouYe(HttpServletRequest request) {
		
		return "showAll";
	}
	
	/**
	 * 
	 * @描述 账目页
	 * @param request
	 * @return
	 */
	@RequestMapping(value="/account")//账目
	public String account(HttpServletRequest request) {
		
		return "account";
	}
	
	/**
	 * 
	 * @描述 购物车页 
	 * @param request
	 * @return
	 */
	@RequestMapping(value="/settleAccount")//购物车
	public String settleAccount(HttpServletRequest request) {
		
		return "settleAccount";
	}
	
	/**
	 * 
	 * @描述 商品发布页
	 * @param request
	 * @return
	 */
	@RequestMapping(value="/public")//发布
	public String mypublic(HttpServletRequest request) {
		
		return "public";
	}
}
